import React, { Component } from 'react';
import { BrowserRouter, Route, withRouter, Switch } from 'react-router-dom';
import { Provider } from 'react-redux';
import store from './store';
// import Home from './Containers/Home';
import style from './page.less';
import { Layout, Menu,Icon } from 'antd';
// import { Icon } from 'react-fa'
import Submenu from '_platform/components/panels/Submenu';
const { Header, Content, Footer, Sider } = Layout;
export default class Page extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }
    async componentDidMount() {
        const { default: Home } = await import('./Containers/Home');
        this.setState({ Home })
    }
    // 页面内容
    render() {
        const { Home } = this.state;
        return (
                <Layout>
                    <Sider style={{ overflow: 'auto', height: '100vh', position: 'fixed', left: 0 }}>
                        <div className="logo" />
                        <Submenu {...this.props} menus={Page.menus} />
                    </Sider>
                    <Layout style={{ marginLeft: 200 }}>
                        <Header style={{ background: '#fff', padding: 0 }} />
                        <Content style={{ margin: '24px 16px 0', overflow: 'initial' }}>
                            <div style={{ padding: 24, background: '#fff', textAlign: 'center' }}>
                                <Switch>
                                    {Home && <Route path='/home' component={Home} />}
                                </Switch>
                            </div>
                        </Content>
                        <Footer style={{ textAlign: 'center' }}>
                            THE ROUTE ©2018 Created by GOD YANG
                        </Footer>
                    </Layout>
                </Layout>
        );
    }
    static menus = [{
        key: 'home',
        id: 'home',
        path: '/home',
        name: '主页',
        icon: <Icon type="solution" />,
    }]
}
